const CommentModel = require('../modules/CommentModel')
module.exports = {
    //获取评论
    post_comment: async function (req, res) {
        let resultArr = [];
        await CommentModel.comment(req)
            .then(res => {
                console.log('===>', res);
                for (var i of res) {
                    resultArr.push(i);
                }
            });
        res.send(resultArr)
    },

    //添加评论
    post_addcomment: async function (req, res) {

        addCommentResult = await CommentModel.addcomment(req.body.userid, req.body.courseid, req.body.textcontent)

        res.send(addCommentResult)

    },

}